import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import * as actions from './redux/actions';

export class Header extends Component {
  static propTypes = {
    common: PropTypes.object.isRequired,
    actions: PropTypes.object.isRequired,
  };

  render() {
    return (
      <div className="common-header fsb padd-15">
         <div className="left">
            <i className="icon iconfont icon-caidan c999"></i>
            <span className="fff f14 mg-l-10">卖座网</span>
        </div>
        <div className="right">
            <router-link to="/city">
                <span className="city c999 f14">城市</span>  
                <i className="icon iconfont icon-parking2 c999"></i>
            </router-link>
           <i className="icon iconfont icon-wo c999 mg-l-10"></i>
        </div>
      </div>
    );
  }
}

/* istanbul ignore next */
function mapStateToProps(state) {
  return {
    common: state.common,
  };
}

/* istanbul ignore next */
function mapDispatchToProps(dispatch) {
  return {
    actions: bindActionCreators({ ...actions }, dispatch)
  };
}

export default connect(
  mapStateToProps,
  mapDispatchToProps
)(Header);
